<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>link between PHP and Mysql</title>
</head>
<body>
<?php
	error_reporting(E_ERROR | E_WARNING | E_PARSE);
	$conn = mysql_connect("127.0.0.1","root","");
	if (!$conn) {
		echo "链接错误";
		exit();
	}
	if (!mysql_query("use study",$conn)) {
		echo "数据库链接失败";
		exit();
	}
	mysql_query("set names utf8",$conn);
	//mysql_query("insert into tb_student value(2014210103,'王玲','女','1988-02-21','安徽','汉','CS1402')",$conn);//添加到MySQL
	//mysql_query("delete from tb_student where classNo='CS1401'");//删除MySQL中数据
	//mysql_query("update tb_student set sex='女', nation='回' where studentNo='2014310101'",$conn);//修改MySQL中数据
	$resourse = mysql_query("select * from tb_student",$conn);   //php中调用mysql数据
	$data = array();
	while ($row = mysql_fetch_row($resourse)){
		$data[] = $row;
	}
	var_dump($data);
?>
</body>
</html>